﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.Collections;

namespace BelleApp
{
    public partial class SearchRFQ : Form
    {

        int RFQnum = 0;
        public SearchRFQ()
        {
            InitializeComponent();
            
        }
        
        private void btnSearchRFQ_Click(object sender, EventArgs e)
        {
            if (textBox1.Text == "")
            {

                MessageBox.Show("PLEASE FILL IN THE RFQID!");

            }
            else
            {
                RFQ RFQ = new RFQ();
                DBManager db = new DBManager();
                RFQnum = Convert.ToInt32(textBox1.Text);
                ArrayList RFQList = new ArrayList();
                RFQList = db.SearchRFQ(RFQnum);
                if (RFQList.Count == 0)
                {

                    MessageBox.Show("RFQID NOT FOUND! PLEASE TRY AGAIN!");

                }
                else
                {
                    dgvSearch.DataSource = RFQList;
                }
            }
        }
        private void dgvSearch_CellMouseDoubleClick(object sender, DataGridViewCellMouseEventArgs e)
        {
            DisplayFullDetails display = new DisplayFullDetails(RFQnum);
            display.Show();
            this.Hide();
        }
    }
}
